Integrand size = 34, antiderivative size = 105 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\cot ^{\frac {3}{2}}(c+d x)} \, dx=-\frac {2 \sqrt [4]{-1} a (i A+B) \text {arctanh}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}+\frac {2 i a B}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {2 a (i A+B)}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A-i B)}{d \sqrt {\cot (c+d x)}} \]
[Out]
Time = 0.35 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.147, Rules used = {3662, 3672, 3610, 3614, 214} \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\cot ^{\frac {3}{2}}(c+d x)} \, dx=-\frac {2 \sqrt [4]{-1} a (B+i A) \text {arctanh}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}+\frac {2 a (B+i A)}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A-i B)}{d \sqrt {\cot (c+d x)}}+\frac {2 i a B}{5 d \cot ^{\frac {5}{2}}(c+d x)} \]
[In]
[Out]
Rule 214
Rule 3610
Rule 3614
Rule 3662
Rule 3672
Rubi steps \begin{align*} \text {integral}& = \int \frac {(i a+a \cot (c+d x)) (B+A \cot (c+d x))}{\cot ^{\frac {7}{2}}(c+d x)} \, dx \\ & = \frac {2 i a B}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\int \frac {a (i A+B)+a (A-i B) \cot (c+d x)}{\cot ^{\frac {5}{2}}(c+d x)} \, dx \\ & = \frac {2 i a B}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {2 a (i A+B)}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\int \frac {a (A-i B)-a (i A+B) \cot (c+d x)}{\cot ^{\frac {3}{2}}(c+d x)} \, dx \\ & = \frac {2 i a B}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {2 a (i A+B)}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A-i B)}{d \sqrt {\cot (c+d x)}}+\int \frac {-a (i A+B)-a (A-i B) \cot (c+d x)}{\sqrt {\cot (c+d x)}} \, dx \\ & = \frac {2 i a B}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {2 a (i A+B)}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A-i B)}{d \sqrt {\cot (c+d x)}}+\frac {\left (2 a^2 (i A+B)^2\right ) \text {Subst}\left (\int \frac {1}{a (i A+B)-a (A-i B) x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{d} \\ & = -\frac {2 \sqrt [4]{-1} a (i A+B) \text {arctanh}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}+\frac {2 i a B}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {2 a (i A+B)}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {2 a (A-i B)}{d \sqrt {\cot (c+d x)}} \\ \end{align*}
Time = 1.99 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.94 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\cot ^{\frac {3}{2}}(c+d x)} \, dx=\frac {2 i a \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)} \left (3 B \tan ^{\frac {5}{2}}(c+d x)+5 (A-i B) \left (-3 (-1)^{3/4} \arctan \left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )+\sqrt {\tan (c+d x)} (-3 i+\tan (c+d x))\right )\right )}{15 d} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 469 vs. \(2 (85 ) = 170\).
Time = 0.40 (sec) , antiderivative size = 470, normalized size of antiderivative = 4.48
method | result | size |
derivativedivides | \(-\frac {a \left (120 i B \sqrt {\tan \left (d x +c \right )}+30 i A \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )-40 i A \tan \left (d x +c \right )^{\frac {3}{2}}-30 i B \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )-30 i B \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+15 i A \sqrt {2}\, \ln \left (-\frac {\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}{1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}\right )-15 i B \sqrt {2}\, \ln \left (-\frac {1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}{\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}\right )+30 i A \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )-40 B \tan \left (d x +c \right )^{\frac {3}{2}}+15 A \sqrt {2}\, \ln \left (-\frac {1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}{\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}\right )+30 A \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+30 A \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )-24 i B \tan \left (d x +c \right )^{\frac {5}{2}}+30 B \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+30 B \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+15 B \sqrt {2}\, \ln \left (-\frac {\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}{1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}\right )-120 A \sqrt {\tan \left (d x +c \right )}\right )}{60 d \left (\frac {1}{\tan \left (d x +c \right )}\right )^{\frac {3}{2}} \tan \left (d x +c \right )^{\frac {3}{2}}}\) | \(470\) |
default | \(-\frac {a \left (120 i B \sqrt {\tan \left (d x +c \right )}+30 i A \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )-40 i A \tan \left (d x +c \right )^{\frac {3}{2}}-30 i B \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )-30 i B \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+15 i A \sqrt {2}\, \ln \left (-\frac {\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}{1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}\right )-15 i B \sqrt {2}\, \ln \left (-\frac {1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}{\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}\right )+30 i A \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )-40 B \tan \left (d x +c \right )^{\frac {3}{2}}+15 A \sqrt {2}\, \ln \left (-\frac {1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}{\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}\right )+30 A \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+30 A \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )-24 i B \tan \left (d x +c \right )^{\frac {5}{2}}+30 B \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+30 B \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+15 B \sqrt {2}\, \ln \left (-\frac {\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}{1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}\right )-120 A \sqrt {\tan \left (d x +c \right )}\right )}{60 d \left (\frac {1}{\tan \left (d x +c \right )}\right )^{\frac {3}{2}} \tan \left (d x +c \right )^{\frac {3}{2}}}\) | \(470\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 482 vs. \(2 (81) = 162\).
Time = 0.27 (sec) , antiderivative size = 482, normalized size of antiderivative = 4.59 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\cot ^{\frac {3}{2}}(c+d x)} \, dx=-\frac {15 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{2}}{d^{2}}} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{2}}{d^{2}}} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (i \, A + B\right )} a}\right ) - 15 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{2}}{d^{2}}} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} - {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{2}}{d^{2}}} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (i \, A + B\right )} a}\right ) + 4 \, {\left ({\left (20 i \, A + 23 \, B\right )} a e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (10 i \, A + B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (-20 i \, A - 11 \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (-10 i \, A - 13 \, B\right )} a\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}}{30 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
[In]
[Out]
\[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\cot ^{\frac {3}{2}}(c+d x)} \, dx=i a \left (\int \left (- \frac {i A}{\cot ^{\frac {3}{2}}{\left (c + d x \right )}}\right )\, dx + \int \frac {A \tan {\left (c + d x \right )}}{\cot ^{\frac {3}{2}}{\left (c + d x \right )}}\, dx + \int \frac {B \tan ^{2}{\left (c + d x \right )}}{\cot ^{\frac {3}{2}}{\left (c + d x \right )}}\, dx + \int \left (- \frac {i B \tan {\left (c + d x \right )}}{\cot ^{\frac {3}{2}}{\left (c + d x \right )}}\right )\, dx\right ) \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 191 vs. \(2 (81) = 162\).
Time = 0.31 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.82 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\cot ^{\frac {3}{2}}(c+d x)} \, dx=-\frac {8 \, {\left (-3 i \, B a - \frac {5 \, {\left (i \, A + B\right )} a}{\tan \left (d x + c\right )} - \frac {15 \, {\left (A - i \, B\right )} a}{\tan \left (d x + c\right )^{2}}\right )} \tan \left (d x + c\right )^{\frac {5}{2}} + 15 \, {\left (2 \, \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) + 2 \, \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) - \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \log \left (\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right ) + \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \log \left (-\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right )\right )} a}{60 \, d} \]
[In]
[Out]
\[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\cot ^{\frac {3}{2}}(c+d x)} \, dx=\int { \frac {{\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}}{\cot \left (d x + c\right )^{\frac {3}{2}}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\cot ^{\frac {3}{2}}(c+d x)} \, dx=\int \frac {\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}{{\mathrm {cot}\left (c+d\,x\right )}^{3/2}} \,d x \]
[In]
[Out]